<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <style>
        *{
            margin: 0px;
            padding: 0px;
            list-style: none;
        }
        ul{
            overflow: hidden;
            margin-left: 143px;
        }
        ul li{
            float: left;
            width: 100px;
            height: 30px;
            margin-left: 5px;
            border-bottom: 1px solid rgb(172, 172, 175);
        }
        ul li:nth-of-type(1){
            background: rgb(120, 190, 248);
            border-bottom: 1px solid rgb(172, 172, 175);
        }
        div{
            width: 500px;
            height: 200px;
            text-align: center;
            display: none;
            position: relative;  
        }
   
        div:nth-of-type(1){
            display: block;
        }
        input{
            width: 200px;
            height: 20px;
            margin-top: 20px;
        }
        input.a1{
            width: 50px;
            height: 20px;

        }
        input.a2{
            width: 140px;
            height: 20px;

        }
        div.b1 a{
            position: absolute;
            bottom: 80px;
            left: 265px;
            text-decoration: none;
            color: dimgray;

        }
        div.b2 a{
            position: absolute;
            top: 65px;
            left: 260px;
            text-decoration: none;
            color: dimgray;
        }
        div.b1 span{
            width: 100px;
            height: 25px;
            position: absolute;
            bottom: 40px;
            left: 270px;
            border: 1px solid skyblue;
            cursor: pointer;
            border-radius: 80%;
        }
        div.b1 span:hover{
            background: skyblue;
            color: snow;
            border: 1px solid skyblue;
            cursor: pointer;
            border-radius: 80%;
        }
        div.b2 span{
            width: 100px;
            height: 25px;
            position: absolute;
            bottom: 40px;
            left: 270px;
            border: 1px solid skyblue;
            cursor: pointer;
            border-radius: 80%;
        }
        div.b2 span:hover{
            background: skyblue;
            color: snow;
            border: 1px solid skyblue;
            cursor: pointer;
            border-radius: 80%;
        }


    </style>
    <body>
        <ul>
            <li>密码登录</li>
            <li>短信登录</li>
            
   
        </ul>
        <div class="b1">
            <input type="text" placeholder="登录用户名/邮箱"><br>
            <input type="text" placeholder="密码">
            <a href="">忘记密码？</a>
            <span>点击登录</span>
        </div>
        <div class="b2">
            <input type="text" class="a1" value="+86">
            <input type="text" class="a2" placeholder='手机号'><br>
            <input type="text" placeholder='验证码'>
            <a href="">获取验证码</a>
            <span>点击登录</span>
        </div>



        <script>

             var tags=document.getElementsByTagName('li');
            var boxs=document.getElementsByTagName('div');


            for(var i=0;i<tags.length;i++){

                tags[i].index=i;
                tags[i].onclick=function(){

                    for(var j=0;j<tags.length;j++){
                        tags[j].style.background="none";
                       
                        
                        boxs[j].style.display="none"
                    }
               
                    this.style.background='rgb(120, 190, 248)';
            
                    var n=this.index;
    
                    boxs[n].style.display='block'
                }
            }

        </script>
    </body>
</html> 